function [flag,error_message] = checkFormat(price_path,reference_dates,initial_price,strike_price ...
                           ,target_price,conditions,equations)
    flag = 1;
    error_message = '';
    equa_len = length(equations);
    cond_len = length(conditions);
    %Check conditions
    i=1;
    for j = 1:cond_len
        cond_temp = conditions{j};
        try eval(cond_temp)
        catch err
            error_message = err.identifier;
            if or(strcmp(error_message,'MATLAB:UndefinedFunction') ...
                    ,strcmp(error_message,'MATLAB:m_missing_operator'))
                error_message = 'Conditions error: Wrong parameters';
                flag = 0;
                return
            elseif strcmp(error_message,'MATLAB:badsubscript')
                error_message = 'Conditions error: Missing or wrong reference dates';
                flag = 0;
                return
            end
        end
    end
    %Check equations
    if equa_len <= cond_len
    	error_message = 'Equations error: Missing equations';
        flag = 0;
        return
    elseif equa_len > cond_len+1
        error_message = 'Equations error: Too many equations';
        flag = 0;
        return
    end
    for j = 1:equa_len
        equa_temp = equations{j};
        try eval(equa_temp)
        catch err
            error_message = err.identifier;
            if or(strcmp(error_message,'MATLAB:UndefinedFunction') ...
                    ,strcmp(error_message,'MATLAB:m_missing_operator'))
                error_message = 'Equations error: Wrong parameters';
                flag = 0;
                return
            elseif strcmp(error_message,'MATLAB:badsubscript')
                error_message = 'Equations error: Missing or wrong reference dates';
                flag = 0;
                return
            end
        end
    end